home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / ISSUE20 / CLINIC / NEWCHK2.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1997-01-27  |  657 b   |  35 lines

  1. unit NewChk2;
  2.  
  3. interface
  4.  
  5. uses
  6.   SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  7.   Forms, Dialogs, StdCtrls;
  8.  
  9. type
  10.   TNewCheck2 = class(TCheckBox)
  11.   public
  12.     procedure CMWantSpecialKey(var Msg: TCMWantSpecialKey);
  13.       message cm_WantSpecialKey;
  14.   end;
  15.  
  16. procedure Register;
  17.  
  18. implementation
  19.  
  20. procedure TNewCheck2.CMWantSpecialKey(var Msg: TCMWantSpecialKey);
  21. begin
  22.   inherited;
  23.   with Msg do
  24.     if CharCode in [vk_Up, vk_Down] then
  25.       { Return 1 to stop the keystrokes being "absorbed" }
  26.       Result := 1;
  27. end;
  28.  
  29. procedure Register;
  30. begin
  31.   RegisterComponents('Clinic', [TNewCheck2]);
  32. end;
  33.  
  34. end.
  35.